#!/usr/bin/ruby -Ku
# -*- coding: utf-8 -*-
require 'test/unit'
require 'm3g'

class Test_RayIntersection < Test::Unit::TestCase
  def setup
  end

  def teadown
  end

  def test_defualt_variables
    ri = M3G::RayIntersection.new

    # 注意:法線のデフォルト値は(0,0,1).
    # 現在の実装は(0,0,0)を返すのでバグっている

    assert_equal nil          , ri.intersected
    assert_equal 0            , ri.distance
    assert_equal 0            , ri.submesh_index
    assert_equal [0,0,0,0,0,1], ri.ray
    assert_equal 0            , ri.normal.x
    assert_equal 0            , ri.normal.y
    assert_equal 0            , ri.normal.z      # 注意:本当はここは1が正しい
    assert_equal 0            , ri.texture[0].s
    assert_equal 0            , ri.texture[0].t
  end

end
